'use strict';
module.exports = {
	/**
	 * XXXnameXXX
	 * @url client/user/kh/updatePaymentInfo 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid, wechat_payment_real_name, wechat_payment_code_url } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------
    let dbName = 'uni-id-users'
     let curUser = await vk.baseDao.findById({
       dbName,
       id: uid
     });
     if (!curUser) {
       return { code: -1, msg: '用户不存在' }
     }
     
    let f = await vk.baseDao.updateById({
       dbName,
       id: uid,
       dataJson: {
         wechat_payment_real_name,
         wechat_payment_code_url,
       },
        getUpdateData:true
     });
     console.log(f)
     res.msg = '更新成功'

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
